package com.juc.threadPoolExecutor.threadPoolExecutor12;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Run1 {

	
	public static void main(String[] args) {
		Runnable runnable = new Runnable() {
			
			@Override
			public void run() {
				try {
					System.out.println("打印了！begin " + Thread.currentThread().getName());
					Thread.sleep(4000);
					System.out.println("打印了！end " + Thread.currentThread().getName());
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			}
		};
		ThreadPoolExecutor pool = new ThreadPoolExecutor(2, 2, 5, TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>());
	    System.out.println(" 线程池中的线程数A ： " + pool.getPoolSize());
	    System.out.println(" Z1= ： " + pool.prestartCoreThread());
	    System.out.println(" 线程池中的线程数B ： " + pool.getPoolSize());
	    System.out.println(" Z2= ： " + pool.prestartCoreThread());
	    System.out.println(" 线程池中的线程数C ： " + pool.getPoolSize());
	    System.out.println(" Z3= ： " + pool.prestartCoreThread());//无效代码
	    System.out.println(" Z4= ： " + pool.prestartCoreThread());//无效代码
	    System.out.println(" Z5= ： " + pool.prestartCoreThread());//无效代码
	    System.out.println(" Z6= ： " + pool.prestartCoreThread());//无效代码
	    System.out.println(" 线程池中的线程数D ： " + pool.getPoolSize());
	}
}
